package student_system.dep_Controller;

import student_system.Dao.depdao;
import student_system.bean.dep;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/depalter1")
public class depalter_ser1 extends HttpServlet {
    depdao dao=new depdao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       // super.doPost(req, resp);
        req.setCharacterEncoding("utf-8");
        String dno=req.getParameter("dno");
        //int sno= Integer.parseInt(snoStr);

        dep dep=dao.selectbydno(dno);

        //List<student> list=dao.testArrayList();
        req.setAttribute("deplists",dep);
        RequestDispatcher dispatcher =req.getRequestDispatcher("depalter.jsp");
        dispatcher.forward(req,resp);
    }
}
